package com.wwl.thread;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ExecutorDemo {
    public static void main(String[] args) {
        //创建线程池，最大线程数量指定为3
        ExecutorService executor = Executors.newFixedThreadPool(3);
        //想线程池中提交待执行任务
        executor.execute(new PrintChar());
        executor.execute(new PrintNumber());
        //关闭线程池
        executor.shutdown();
    }
}
